const startServer = require('quickly-deploy')
const path = require('path')

// env path
const envPath = path.resolve(__dirname, './server.env')

const app = startServer([path.resolve(__dirname, './dist')], envPath, [], [
  async (ctx, next) => {
    // 配置浏览器缓存：设置缓存控制头，max-age为缓存时间，单位为秒，不频繁更新默认为七天（一周）
    ctx.set('Cache-Control', 'max-age=604800');
    await next();
  }
])
// start server
app.start()